Repository navigation
Check existing alerts on code-only changes with --strict-blocking - #462
Conversation
Without --ignore-commit-files, the CLI reads the changed files to decide whether to compare. When none is a supported manifest it sets force_api_mode, creates a full scan of the target path, and turns blocking off because a full scan has no baseline. That fallback exists so a change that cannot alter dependencies doesn't post a comment or block on alerts it didn't introduce. Under --strict-blocking it also skipped the check the flag exists for: a code-only pull request passed with a warning that --strict-blocking needs diff mode, even when the repository had existing blocking alerts. With --strict-blocking, a change that touches no manifest now runs the comparison over every manifest in the target path, the same way --ignore-commit-files does. Existing alerts are loaded from the new full scan and fail the run, and PR/MR comments list them. Failures reading them keep the infrastructure-error code. Runs without --strict-blocking keep the full-scan fallback, and SCM branch pipelines still create a full scan.
--strict-blocking when no manifest changed
The no-manifest message was logged when the mode was chosen, before the SCM event type was known. Skipped pull request events (closed, for example) printed that every manifest would be compared and then exited without a scan, and SCM branch pipelines printed it before creating a full scan. Log it after the event check, only when the run goes on to compare. Document the wider reach of the change: without --scm, default-branch pushes and non-git target paths now compare under --strict-blocking and can fail on existing blocking alerts. Note that --reach pull request scans need a default-branch scan made with --reach, and reword the API Mode line. Add tests for GitLab merge request and branch pipelines, an API-mode default-branch push, and the log message. The branch pipeline tests now return a blocking alert from the full scan, so they fail if blocking were left on.
…o-manifest-change # Conflicts: # CHANGELOG.md
…o-manifest-change
…o-manifest-change # Conflicts: # CHANGELOG.md
2.13.2 was released from main, so this change needs the next patch version.
Exercise the comparison and SDK parser from the CLI. Verify that incomplete comparisons and missing existing-alert data use the configured exit policy. Document scan scope, baseline selection, and the upgrade impact.
--strict-blocking when no manifest changed--strict-blocking
|
bugbot run |
PR SummaryMedium Risk Overview The CLI sets Release 2.14.0 bumps Reviewed by Cursor Bugbot for commit 2c6eb6c. Configure here. |
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2c6eb6c. Configure here.
# Conflicts: # CHANGELOG.md
Behavior
--strict-blockingcompares scans when a change touches no supported manifest. It uses the configured scan scope and the existing comparison path. Block findings fail the run, and SCM pull requests and merge requests report existing findings in the security comment.GitHub and GitLab branch pipelines without PR/MR context using
--scmstill run non-blocking full scans. Without either adapter, code-only default-branch pushes and scans of non-git paths can now fail on policy or comparison errors. If the pipeline previously ran only full scans, check the API token scopes for comparisons.Verification
Release
Ships in 2.14.0. Merge order: #461 → #462 → #460 → #464 → #465 → #463. Merged together in that order on
mainat #459, the six pass the full test suite andruff check.mainrequires branches to be up to date, so update each PR frommainafter the previous merge.CHANGELOG.mdwill conflict each time: combine the bullets under the existing## 2.14.0subsections (Upgrade notes, Changed, Fixed, Documentation) by hand rather than taking either side.This is 2 of 6, after #461. When #460 is updated after this merges,
docs/ci-cd.mdconflicts in one paragraph; #460's description has the resolution.Upgrade impact. With
--scm api(the default),--strict-blockingnow runs a comparison for code-only jobs that previously fell back to a full scan. This includes default-branch pushes. If a job previously only uploaded scans, check forfull-scans:listto read scan data andrepo:listif the CLI selects the baseline automatically. See the upgrade guide in #463.Measured timing. The author measured about 13–14 seconds end to end for the comparison and about 1 second for the full-scan fallback on the same inputs in a test org. Comparison timings were in line with runs that already used
--ignore-commit-files.Public Changelog
--strict-blockingnow checks existing Block findings on code-only changes and reports them in pull and merge request comments. Without a GitHub or GitLab SCM adapter, default-branch pushes and scans of non-git paths can also fail on Block findings or comparison errors.Fixes: CE-515
Refs: ASK-631